﻿package plugin.npcDialog.ui.panels.active
{
    import cmd.*;
    import manager.*;
    import morn.core.handlers.*;
    import pluginfw.nio.*;
    import uiresource.npcdialogs.*;

    public class HjQuitGame extends HjOutUI implements INpcDialogContent
    {
        private var _data:Object;

        public function HjQuitGame()
        {
            this.initEvent();
            return;
        }// end function

        private function initEvent() : void
        {
            link_cancel.clickHandler = new Handler(this.doClose);
            link_quit.clickHandler = new Handler(this.doQuit);
            return;
        }// end function

        private function doClose() : void
        {
            PluginManager.instance.closePlugin("npcdialog");
            return;
        }// end function

        public function show(param1:Object, param2:Object) : void
        {
            this._data = param1;
            return;
        }// end function

        private function doQuit() : void
        {
            var _loc_1:* = ConfigDictionary.data.deliver[1221][0];
            var _loc_2:* = new Output();
            _loc_2.writeVarInt(_loc_1.stageid, false);
            _loc_2.writeVarInt(_loc_1.x, false);
            _loc_2.writeVarInt(_loc_1.y, false);
            PluginManager.instance.sendToBufferServer("activity", CMDActivity.IntoBossInstance, _loc_2);
            return;
        }// end function

        public function close() : void
        {
            if (this.parent)
            {
                this.parent.removeChild(this);
            }
            return;
        }// end function

        public function update(param1:Object, param2:int = 0) : void
        {
            return;
        }// end function

    }
}
